import grpc

import AI_pb2
import AI_pb2_grpc

def run():
    with grpc.insecure_channel('localhost:8082') as channel:
        stub = AI_pb2_grpc.AIServiceStub(channel)
        print("hello")
        scripts_response = stub.InitializeScript(AI_pb2.ScriptInitializer(script_id='1'))
        response = stub.Ask(AI_pb2.AIRequest(fileID='13', content='Hello AI!', data='p'))
        print(f"Response received: success={response.code}, token={response.message}")

if __name__ == '__main__':
    run()
